package com.pasabahceambalaj.entity;

// Generated Oct 8, 2013 12:01:41 AM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;
import org.hibernate.validator.NotNull;

/**
 * Isemirmalzeme generated by hbm2java
 */
@Entity
@Table(name = "isemirmalzeme", catalog = "ambalaj", uniqueConstraints = @UniqueConstraint(columnNames = { "isemirid", "malzemeid" }))
public class Isemirmalzeme implements java.io.Serializable {

	private Long id;
	private int version;
	private Malzeme malzeme;
	private Isemir isemir;
	private Integer miktar;
	private long makskullanimmiktari;
	private Set<Isemirhareket> isemirharekets = new HashSet<Isemirhareket>(0);

	public Isemirmalzeme() {
	}

	public Isemirmalzeme(Malzeme malzeme, Isemir isemir, long makskullanimmiktari) {
		this.malzeme = malzeme;
		this.isemir = isemir;
		this.makskullanimmiktari = makskullanimmiktari;
	}

	public Isemirmalzeme(Malzeme malzeme, Isemir isemir, Integer miktar, long makskullanimmiktari, Set<Isemirhareket> isemirharekets) {
		this.malzeme = malzeme;
		this.isemir = isemir;
		this.miktar = miktar;
		this.makskullanimmiktari = makskullanimmiktari;
		this.isemirharekets = isemirharekets;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "malzemeid", nullable = false)
	@NotNull
	public Malzeme getMalzeme() {
		return this.malzeme;
	}

	public void setMalzeme(Malzeme malzeme) {
		this.malzeme = malzeme;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "isemirid", nullable = false)
	@NotNull
	public Isemir getIsemir() {
		return this.isemir;
	}

	public void setIsemir(Isemir isemir) {
		this.isemir = isemir;
	}

	@Column(name = "miktar")
	public Integer getMiktar() {
		return this.miktar;
	}

	public void setMiktar(Integer miktar) {
		this.miktar = miktar;
	}

	@Column(name = "makskullanimmiktari", nullable = false)
	public long getMakskullanimmiktari() {
		return this.makskullanimmiktari;
	}

	public void setMakskullanimmiktari(long makskullanimmiktari) {
		this.makskullanimmiktari = makskullanimmiktari;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "isemirmalzeme")
	public Set<Isemirhareket> getIsemirharekets() {
		return this.isemirharekets;
	}

	public void setIsemirharekets(Set<Isemirhareket> isemirharekets) {
		this.isemirharekets = isemirharekets;
	}

}
